import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// rem适配插件
import 'lib-flexible'
Vue.config.productionTip = false
    // vue路由的全局拦截器
router.beforeEach((to, from, next) => {
    if (to.name == "reg" || to.name == "login" || to.name == "coursebuy" || to.name == "learn") {
        store.commit("changeFlag", false); //隐藏脚步
    } else {
        store.commit("changeFlag", true); //显示脚步
    }
    next();
})

// 引入样式重置
import './assets/style/common.css'
import { Card, SwipeCell, GoodsAction, GoodsActionIcon, GoodsActionButton, Rate, Tab, Tabs, Cell, CellGroup, Toast, Button, Field, List, PullRefresh, DropdownMenu, DropdownItem, Tabbar, TabbarItem, Search, Icon, Swipe, SwipeItem, Popup, NavBar } from 'vant';
Vue.use(Search);
Vue.use(Card)
Vue.use(SwipeCell)
Vue.use(GoodsAction)
Vue.use(GoodsActionIcon)
Vue.use(GoodsActionButton)
Vue.use(Rate)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(CellGroup)
Vue.use(Cell)
Vue.use(Button)
Vue.use(Field)
Vue.use(List)
Vue.use(PullRefresh)
Vue.use(Popup)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Swipe)
Vue.use(NavBar)
Vue.use(SwipeItem)
Vue.use(Tabbar);
Vue.use(Icon)
Vue.use(TabbarItem);
Vue.prototype.$message = Toast;


new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')